package net.mihome.app.bean;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.httpclient.methods.multipart.StringPart;

public class RssResource {
	private String title;
	private String href;
	private long id;
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	
	public String getHref() {
		return href;
	}
	public void setHref(String href) {
		this.href = href;
	}
	public static List<RssResource> parseList(String[] resStr){
		List<RssResource> list=new ArrayList<RssResource>();
		if(resStr!=null){
			for(int i=0;i<resStr.length;i++){
				String str=resStr[i];
				String[] rssStr=str.split("--");
				RssResource rssResource=new RssResource();
				rssResource.setId(Long.valueOf(i));
				rssResource.setTitle(rssStr[0]);
				rssResource.setHref(rssStr[1]);
				list.add(rssResource);
			}
		}
		return list;
	}
}
